ChipDecoration

sealed class ChipDecoration

Represents an icon or image displayed before or after a SourceChip's text.

Icons are 18.dp tall and the Images are 24.dp tall.

The icon or image will be tinted with the SourceChip.Style.contentColour. To override the tinting, use ChipDecoration.Icon.Component or ChipDecoration.Image.Component and provide a custom composable function with the desired colour.

For icons, prefer to use ChipDecoration.Icon.Vector with a Source.Icons vector where possible. Alternatively use ChipDecoration.Icon.Painter with a drawable resource ID.

For images, prefer to use ChipDecoration.Image.Painter for static images. For images fetched from the network, use ChipDecoration.Image.Component with a custom composable function.

Inheritors

Types

Link copied to clipboard
sealed class Icon : ChipDecoration

Represents an Icon displayed before/after the chip's text. Icons are 18.dp tall and will be tinted with the SourceChip.Style.contentColour.

Link copied to clipboard
sealed class Image : ChipDecoration

Represents an Image displayed before/after the chip's text. Images are 24.dp tall.

Link copied to clipboard
data object None : ChipDecoration

Represents no image or icon displayed before/after the chip's text.

Properties

Link copied to clipboard
abstract val content: @Composable RowScope.(Modifier) -> Unit

The content to display. The provided modifier must be set on the content. The modifier is used to apply the correct size to the icon/image.

Link copied to clipboard
abstract val height: Dp

The height of the icon/image.